package com.itheima.sh.response;

public enum StatusCode {

    // 成功段0
    SUCCESS(0,"操作成功"),
    ERROR(50000,"操作失败"),
    SYS_ERROR(99999,"您的网络有问题，请稍后重试 亲(づ￣3￣)づ╭❤～"),
    // 登录段1~50
    NEED_LOGIN(1,"需要登录后操作"),
    LOGIN_PASSWORD_ERROR(2,"密码错误"),
    // TOKEN50~100
    TOKEN_INVALID(50,"无效的TOKEN"),
    TOKEN_EXPIRE(51,"TOKEN已过期"),
    TOKEN_REQUIRE(52,"TOKEN是必须的"),
    // SIGN验签 100~120
    SIGN_INVALID(100,"无效的SIGN"),
    SIG_TIMEOUT(101,"SIGN已过期"),
    // 参数错误 500~1000
    PARAM_REQUIRE(500,"缺少参数"),
    PARAM_INVALID(501,"无效参数"),
    ARITHMETIC_ERROR(505,"无效参数"),
    PARAM_IMAGE_FORMAT_ERROR(502,"图片格式有误"),
    SERVER_ERROR(503,"服务器内部错误"),
    // 数据错误 1000~2000
    DATA_EXIST(1000,"数据已经存在"),
    AP_USER_DATA_NOT_EXIST(1001,"ApUser数据不存在"),
    DATA_NOT_EXIST(1002,"数据不存在"),
    // 数据错误 3000~3500
    NO_OPERATOR_AUTH(3000,"无权限操作"),

    //######################业务常量####################
    // User 4000-4500
    APUSER_UPDATESTATUS_ERROR(4001,"审核失败，请联系管理员"),
    USER_DATAPARAM_INVALID_ERROR(4002,"参数非法"),


    // 订单Order  4501-5000
    ORDER_ADD_ERROR(4501,"订单新增失败"),
    ORDER_DELETE_ERROR(4502,"订单撤销失败"),

    // 文件管理相关
    FILE_UPLOAD_ERROR(8001,"文件上传失败"),
    FILE_UPLOAD_PARAMREQUIRE_ERROR(8002,"文件上传参数无效");

    int code;
    String message;

    StatusCode(int code, String message){
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
